package com.zdsoft.blp.gongyong.dialog;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.view.WindowManager;

/**
 * Created by pc on 2016/9/12.
 */
public  class ShowOrDismissDialog {
    private  static  CustomDailog customDailog;
    private static ProgressDialog dialog;
    public static void show(Activity activity){
        if(customDailog == null){
            customDailog = new CustomDailog(activity);
            customDailog.show();
            WindowManager.LayoutParams params= customDailog.getWindow().getAttributes();
            params.width = 500;
            params.height =300;
            customDailog.getWindow().setAttributes(params);
        }
    }

    public static void dismiss(){
        if(customDailog!=null&&customDailog.isShowing()){
            customDailog.dismiss();
        }
    }

   /* public  static void showDialog(Activity activity){
        if(dialog==null){
            dialog = new ProgressDialog(activity);
            dialog.setMessage("正在上传");
            dialog.show();
        }
    }
    public static void dismissDialog(){
        if(dialog!=null&&dialog.isShowing()){
            dialog.dismiss();
        }
    }*/
}
